package se.webbzon.boltzmann.minigame.cells;

import se.webbzon.boltzmann.minigame.chemistry.AmmoniaMolecule;
import se.webbzon.boltzmann.minigame.chemistry.CarbonDioxideMolecule;
import se.webbzon.boltzmann.minigame.chemistry.HydrogenMolecule;
import se.webbzon.boltzmann.minigame.chemistry.NitrogenMolecule;
import se.webbzon.boltzmann.minigame.chemistry.OxygenMolecule;
import se.webbzon.boltzmann.minigame.chemistry.SandBoxMolecule;
import se.webbzon.boltzmann.minigame.chemistry.SugarMolecule;
import se.webbzon.boltzmann.minigame.chemistry.WaterMolecule;
import se.webbzon.boltzmann.minigame.machine.SandBoxPipe;
import se.webbzon.oschi01.utilities.Direction;

public class MoleculePipe extends SandBoxPipe<SandBoxMolecule> {
	
	/*============================================================
	Constructors
	============================================================*/

	public MoleculePipe() {
		super(Direction.UP);
	}
	
	/*============================================================
	Protected Methods
	============================================================*/

	@Override protected SandBoxMolecule createSandBoxItem() {
		int c = (int) (7 * Math.random());
		SandBoxMolecule m;
		switch (c) {
		case 0: m = new OxygenMolecule(); break;
		case 1: m = new CarbonDioxideMolecule(); break;
		case 2: m = new SugarMolecule(); break;
		case 3: m = new HydrogenMolecule(); break;
		case 4: m = new NitrogenMolecule(); break;
		case 5: m = new AmmoniaMolecule(); break;
		default: m = new WaterMolecule(); break;
		}
		m.setVelocityDirection(- Math.PI/3 - Math.PI/3 * Math.random());
		return m;
	}

}
